package com.chinairi.mall.service;

import com.chinairi.mall.controller.viewobject.GoodsInfoVO;
import com.chinairi.mall.controller.viewobject.ProjectPlanPurchaseServiceVO;
import com.chinairi.mall.controller.viewobject.ProjectPlanPurchaseVO;
import com.chinairi.mall.model.ProjectPlanPurchase;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinairi.mall.model.ProjectPlanReqDetail;
import com.chinairi.mall.model.UserCompanyInfo;
import com.chinairi.mall.service.modelobject.CompShopMO;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author gsl
 * @since 2020-09-19
 */
public interface IProjectPlanPurchaseService extends IService<ProjectPlanPurchase> {

    /**
     * 生成需求计划
     *
     * @param projectPlanPurchaseVO
     */
    void add(ProjectPlanPurchaseVO projectPlanPurchaseVO);

    /**
     * 获取某个需求计划下的采购计划列表
     *
     * @param planReqId
     * @return list
     */
    List<ProjectPlanPurchase> getList(String planReqId);

    /**
     * 获取采购计划详情
     *
     * @param planPurchaseId
     * @return
     */
    List<ProjectPlanReqDetail> getReqDetail(String planPurchaseId);

    /**
     * 获取供应商排行榜
     *
     * @param planPurchaseId
     * @return
     */
    Map<String, List<CompShopMO>> getShopRankList(String planPurchaseId);

    /**
     * 按店铺集中采购商品
     *
     * @param goodsDbidList
     * @return
     */
    List<GoodsInfoVO> getCollectByShop(List<String> goodsDbidList);

    /**
     * 采购计划添加服务
     *
     * @param stringObjectMap
     */
    void addService(HashMap<String, Object> stringObjectMap);

    /**
     * 根据服务类型查询服务商
     *
     * @param serviceType
     * @return
     */
    List<UserCompanyInfo> getServerCompByType(String serviceType);

    /**
     * 获取采购计划中绑定的服务
     *
     * @param planPurchaseId
     * @return
     */
    ProjectPlanPurchaseServiceVO getService(String planPurchaseId);

    /**
     * 更新采购计划中的额服务
     *
     * @param purchaseService
     */
    void addOrUpdateService(ProjectPlanPurchaseServiceVO purchaseService);

    /**
     * 获取用户自己所有的采购计划列表
     * @return
     */
    List<ProjectPlanPurchaseVO> getAllList();
}
